/**
* Copyright (c) 2022 - present TinyVue Authors.
* Copyright (c) 2022 - present Huawei Cloud Computing Technologies Co., Ltd.
*
* Use of this source code is governed by an MIT-style license.
*
* THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL,
* BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
* A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
*
*/

@import '../custom.less';
@import './vars.less';

@select-dropdown-item-prefix-cls: ~'@{css-prefix}select-dropdown__item';
@svg-prefix-cls: ~'@{css-prefix}svg';
@select-dropdown-prefix-cls: ~'@{css-prefix}select-dropdown';

.@{select-dropdown-prefix-cls}{
  .component-css-vars-option();
  &.is-multiple{
    .@{select-dropdown-item-prefix-cls} {
      &.selected {
        color: var(--ti-select-dropdown-item-text-color);
        background-color: var(--ti-select-dropdown-item-bg-color);

        &.is-disabled {
          color: var(--ti-select-dropdown-item-disabled-text-color);
      
          &:hover {
            background-color: var(--ti-select-dropdown-item-disabled-bg-color);
          }
        }
      }
    }
  }
}

.@{select-dropdown-item-prefix-cls} {  
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ti-select-dropdown-item-text-color);
  font-size: var(--ti-select-dropdown-item-font-size);
  height: var(--ti-select-dropdown-item-height);
  line-height: var(--ti-select-dropdown-item-height);
  cursor: pointer;

  &.is-disabled {
    color: var(--ti-select-dropdown-item-disabled-text-color);
    cursor: not-allowed;

    &:hover {
      background-color: var(--ti-select-dropdown-item-disabled-bg-color);
    }
  }

  &.hover,
  &:hover {
    background-color: var(--ti-select-dropdown-item-hover-bg-color);
  }

  &.selected {
    color: var(--ti-select-dropdown-item-selected-text-color);
    background-color: var(--ti-select-dropdown-item-selected-bg-color);
  }

  .@{svg-prefix-cls} {
    fill: var(--ti-select-dropdown-item-icon-color);
    font-size: var(--ti-select-dropdown-item-icon-font-size);
    margin-right: 8px;
  }

  &.selected .@{svg-prefix-cls},
  &.hover .@{svg-prefix-cls},
  .checked-sur.@{svg-prefix-cls},
  .halfselect.@{svg-prefix-cls} {
    fill: var(--ti-select-dropdown-item-icon-color-selected);
  }

  &.memorize-highlight {
    color: var(--ti-select-dropdown-item-icon-color-selected);
  }
}
